﻿<%@ Page Language="C#" MasterPageFile="~/Shared/EOS.master" AutoEventWireup="True"
    Inherits="EOSCRM.Web.Forms.ChucNang.QLThuMua" CodeBehind="QLThuMua.aspx.cs" %>

<%@ Import Namespace="EOSCRM.Web.Common" %>
<%@ Register Assembly="EOSCRM.Controls" Namespace="EOSCRM.Controls" TagPrefix="eoscrm" %>
<asp:Content ID="head" ContentPlaceHolderID="headCPH" runat="server">
    <script type="text/javascript">
    </script>
</asp:Content>
<asp:Content ID="content" ContentPlaceHolderID="mainCPH" runat="server">
    <asp:UpdatePanel ID="upnlInfor" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <div class="crmcontainer">
                <table class="crmtable">
                    <caption>
                        <br />
                        <tbody>
                            <tr>
                                <td class="crmcell right">
                                    Ngày Hiện Tại
                                </td>
                                <td class="crmcell">
                                    <div class="left">
                                        <asp:Label ID="lbngayhientai" runat="server" Font-Bold="True" Font-Size="Large" ForeColor="Red"></asp:Label>
                                    </div>
                                </td>
                            </tr>
                            
                            <tr>
                                <td class="crmcell right">
                                    Khu vực
                                </td>
                                <td class="crmcell">
                                    <div class="left">
                                        <asp:DropDownList ID="ddlKhuVuc" runat="server" AutoPostBack="true" Height="25px"
                                            OnSelectedIndexChanged="ddlKhuVuc_SelectedIndexChanged" Width="177px">
                                        </asp:DropDownList>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="crmcell right">
                                    Lô Cao Su
                                </td>
                                <td class="crmcell">
                                    <div class="left">
                                        <asp:DropDownList ID="ddlLo" runat="server" AutoPostBack="true" Height="25px" OnSelectedIndexChanged="ddlLo_SelectedIndexChanged"
                                            Width="177px">
                                        </asp:DropDownList>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&nbsp;&nbsp; Lượng mũ trong kho :
                                        <asp:Label ID="lbmu" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="Red"
                                            Text="0"></asp:Label>
                                        &nbsp;kg.
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="crmcell right">
                                    Mã Bán
                                </td>
                                <td class="crmcell">
                                    <div class="left">
                                        <asp:TextBox ID="txtMa" runat="server" MaxLength="20" TabIndex="1" Width="165px" />
                                    </div>
                                </td>
                            </tr>
                            
                            <tr>
                                <td class="crmcell right">
                                    Khối lượng
                                </td>
                                <td class="crmcell">
                                    <div class="left">
                                        <asp:TextBox ID="txtKhoiLuong" runat="server" MaxLength="100" TabIndex="2" Width="165px"
                                            OnTextChanged="txtKhoiLuong_TextChanged" AutoPostBack="true">0</asp:TextBox>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="crmcell right">
                                    Gía
                                </td>
                                <td class="crmcell">
                                    <div class="left">
                                        <asp:TextBox ID="txtgia" runat="server" MaxLength="100" TabIndex="3" Width="165px"
                                            OnTextChanged="txtgia_TextChanged" AutoPostBack="true">0</asp:TextBox>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="crmcell right">
                                    Thành Tiền
                                </td>
                                <td class="crmcell">
                                    <div class="left">
                                        <asp:TextBox ID="txtThanhTien" runat="server" MaxLength="100" TabIndex="4" Width="165px"
                                            ReadOnly="true" Font-Bold="True" Font-Size="Larger" ForeColor="Red">0</asp:TextBox>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="crmcell right">
                                </td>
                                <td class="crmcell">
                                    <div class="left">
                                        <eoscrm:Button ID="btnSave" runat="server" CssClass="save" OnClick="btnSave_Click"
                                            TabIndex="12" Text="" />
                                    </div>
                                    <div class="left">
                                        <eoscrm:Button ID="btnDelete" runat="server" CssClass="delete" OnClick="btnDelete_Click"
                                            TabIndex="13" />
                                    </div>
                                    <div class="left">
                                        <eoscrm:Button ID="btnCancel" runat="server" CssClass="button_order" OnClick="btnCancel_Click"
                                            TabIndex="13" Text="Refresh" />
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </caption>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <asp:UpdatePanel ID="upnlGrid" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <div class="crmcontainer">
                <eoscrm:Grid ID="gvList" runat="server" UseCustomPager="true" OnRowCommand="gvList_RowCommand">
                    <PagerSettings FirstPageText="bán" PageButtonCount="2" />
                    <Columns>
                        <asp:TemplateField HeaderStyle-CssClass="checkbox">
                            <HeaderTemplate>
                                <input id="chkAllTop" title="Chọn hết / Bỏ chọn hết" name="chkAllTop" type="checkbox"
                                    onclick="CheckAllItems(this);" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input id="Id" runat="server" type="hidden" value='<%# Eval("MaThuMua") %>' />
                                <input name="listIds" type="checkbox" value='<%# Eval("MaThuMua") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Mã Thu Mua" HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkBtnID" runat="server" CommandArgument='<%# Eval("MaThuMua") %>'
                                    CommandName="EditItem" Text='<%# Eval("MaThuMua") %>'></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Ngày" DataField="NgayThu" HeaderStyle-Width="28%" />
                        <asp:BoundField HeaderText="Khối Lượng" DataField="SoLuong" HeaderStyle-Width="28%" />
                        <asp:BoundField HeaderText="Thành Tiền" DataField="ThanhTien" HeaderStyle-Width="28%" />
                        <asp:TemplateField HeaderText="Lô" HeaderStyle-Width="30%">
                            <ItemTemplate>
                                <asp:Label ID="lblo" runat="server" Text='<%# Eval("LO.TenLo") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Khu vực" HeaderStyle-Width="30%">
                            <ItemTemplate>
                                <asp:Label ID="lbkhuvuc" runat="server" Text='<%# Eval("LO.KHUVUC.TenKhuVuc") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </eoscrm:Grid>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
